<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html lang="{$smarty.session.lang}">
	<head>
		<title>{$page.strings.backend_title}</title>
		<meta http-equiv="content-type" content="text/html; charset={$_CONF.page.encoding}"/>
		<meta http-equiv="Content-Style-Type" content="text/css" />		
		<link rel="alternate" hreflang="{}" href="{}" />		
		<link rel="canonical" href="{}"/>		
		<link rel="apple-touch-icon" href="" />
		<link rel="shortcut icon" href="" />
		<link rel="stylesheet" href="{$_CONF.paths.base_url}static/local/backend.css" type="text/css" media="screen" />
	</head> 
	<body>
	{if !isset($smarty.session.uid)}
		<div id="loginBox">
			<input type="hidden" id="loginAction" value="{$page.contents.loginAction}"/>
			<br/>
			<label for="username">Username</label><input class="txt" type="text" size="12" id="username"/>
			<br/>
			<br/>
			<label for="password">Password</label><input class="txt" type="password" size="12" id="password"/>
			<br/>
			<br/>
			<button id="loginBtn" type="button">Login</button>
			<br/>
		</div>
	{else}
		Admin panel "splash page"
	{/if}
	<!--Scripts inclusion-->
	<script type="text/javascript" src="{$_CONF.paths.base_url}static/local/js/jquery-1.7.2.min.js"></script>
	{if !isset($smarty.session.uid)}
	<script type="text/javascript">
	{literal}
	$( '#loginBtn' ).bind( 'click', function( ){
		var $_username = $( '#username' );
		var $_password = $( '#password' );		
		if( $_username.val( ) == '' ){
			return false;
		}
		if( $_password.val( ) == '' ){
			return false;
		}
		var _data = {username:$_username.val( ),password:$_password.val( )};
		//Ajax call to login action
		$.ajax({
			url: 			$( '#loginAction' ) .val( ),
			type:			'get',
			dataType:		'json',
			data:			_data,
			success:		function( response ){
				alert( 'vvv' + response );
			},
			error:			function( ){
				
			}
		});
	});
	{/literal}
	</script>
	{/if}
	</body>
</html>